strNum = input()
s = set()
for i in strNum:
    s.add(i)
res = 0
for val in s:
    res = res + int(val)
print(res)
